<?php

namespace App\Admin\Actions\Post;

use Dcat\Admin\Grid\RowAction;
use Illuminate\Http\Request;

class LiveStudio extends RowAction
{
    protected $title = '进入直播间';

    protected $model;

    // 注意构造方法的参数必须要有默认值
    public function __construct(string $model = null)
    {
        $this->model = $model;
    }

    public function handle(Request $request)
    {
        $key = $this->getKey();
        $model = $request->get('model');
        return $this->response()->success('已进入直播间')->refresh();
    }


    public function parameters()
    {
        return [
            'model' => $this->model,
        ];
    }
}